
package com.hw.busi.dao.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import javax.xml.bind.annotation.XmlTransient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * java实体对象基类
 */
public class BaseEntity<T> implements Serializable {
   
   private static final long serialVersionUID = 1L;
   
   /**
    * 自定义SQL（SQL标识，对象）
    */
   protected Map<String, String> sqlMap;
   
   private Page<T> page;
   
   public Page<T> getPage() {
      if (page == null) {
         page = new Page<T>();
      }
      return page;
   }
   
   public void setPage(Page<T> page) {
      this.page = page;
   }
   
   @Override
   public String toString() {
      return ReflectionToStringBuilder.toString(this);
   }
   
   @JsonIgnore
   @XmlTransient
   public Map<String, String> getSqlMap() {
      if (sqlMap == null) {
         Map
         sqlMap = new HashMap();
      }
      return sqlMap;
   }
   
   public void setSqlMap(Map<String, String> sqlMap) {
      this.sqlMap = sqlMap;
   }
   
   /**
    * 删除标记（0：正常；1：删除；2：审核；）
    */
   public static final String DEL_FLAG_NORMAL = "0";
   
   public static final String DEL_FLAG_DELETE = "1";
   
   public static final String DEL_FLAG_AUDIT = "2";
}
